package com.zhouchb.test;

/**
 * @Create 2023-06-19 21:23
 * @Description
 */
public class 最长字符串 {
    public static int lengthOfLastWord(String s) {
        int max = 0;
        String[] strArr =   s.split(" ");
        int length = strArr[strArr.length - 1].length();
        return length;
    }

    public static void main(String[] args) {
        String s = "Today is a nice day";
        int i = lengthOfLastWord(s);
        System.out.println(i);
    }
}
